﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using _4T.DAL;
using _4T.Data;

namespace _4T.BLL
{
    public class PatientInfoBLL
    {
        private PatientInfoDAL patientDAL;
        public PatientInfoDAL PatientDAL
        {
            get
            {
                if (patientDAL == null)
                {
                    patientDAL = new PatientInfoDAL();
                }

                return patientDAL;
            }
        }

        public PatientInfoBLL() { }

        public PatientInfo GetPatientInfo(string profileCode)
        {
            CMS_ProfileInfo info = new ProfileInfoDAL().GetLastProfileInfoByProfileCode(profileCode);
            if (info != null)
            {
                return PatientDAL.GetPatientInfo(info.ProfileInfoCode);
            }
            return null;
        }

        public PatientInfo GetPatientInfoByProfileInfoCode(string profileInfoCode)
        {
            return PatientDAL.GetPatientInfo(profileInfoCode);
        }
    }
}